var myChart = echarts.init(document.getElementById("main"));
console.log(myChart);
var option = {
    title: {
        text: "金义选",
        left: "center",
      },
      grid: [
        {
          left: "5%",
          width: "35%",
          top: "7%",
          height: "50%",
        },
        {
          right: "7%",
          width: "35%",
          top: "7%",
          height: "50%",

        },
      ],
      
      xAxis: [{
        type: 'category',
        boundaryGap: false,
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
        gridIndex: 0,
    },{
        type: 'category',
        data: ['周一', '周二', '周三', '周四', '周五'],
        gridIndex:1,
    }],
    yAxis: [{
        type: 'value',
        gridIndex: 0,
    },{
        type: 'value',
        gridIndex:1,
    }],
    series: [
        {
        data: [623,684,369,216,553,58,85],
        type: 'line',
        areaStyle: {},
        xAxisIndex: 0,
        yAxisIndex: 0,
        },
        {
            name: '直接访问',
            type: 'bar',
            emphasis: {
                focus: 'series',
            },
            data: [320, 332, 301, 334, 390],
            xAxisIndex: 1,
            yAxisIndex: 1,
        },
        {
            name: '邮件营销',
            type: 'bar',
            stack: '广告',
            emphasis: {
                focus: 'series'
            },
            data: [120, 132, 101, 134, 90],
            xAxisIndex: 1,
            yAxisIndex: 1,
        },
        {
            name: '联盟广告',
            type: 'bar',
            stack: '广告',
            emphasis: {
                focus: 'series'
            },
            data: [220, 182, 191, 234, 290],
            xAxisIndex: 1,
            yAxisIndex: 1,
        },
        {
            name: '视频广告',
            type: 'bar',
            stack: '广告',
            emphasis: {
                focus: 'series'
            },
            data: [150, 232, 201, 154, 190],
            xAxisIndex: 1,
            yAxisIndex: 1,
        },
        {
            name: '搜索引擎',
            type: 'bar',
            data: [862, 1018, 964, 1026, 1679],
            emphasis: {
                focus: 'series'
            },
            markLine: {
                lineStyle: {
                    type: 'dashed'
                },
                data: [
                    [{type: 'min'}, {type: 'max'}]
                ]
            },
            xAxisIndex: 1,
            yAxisIndex: 1,
        },
        {
            name: '百度',
            type: 'bar',
            barWidth: 5,
            stack: '搜索引擎',
            emphasis: {
                focus: 'series'
            },
            data: [620, 732, 701, 734, 1090],
            xAxisIndex: 1,
            yAxisIndex: 1,
        },
        {
            name: '谷歌',
            type: 'bar',
            stack: '搜索引擎',
            emphasis: {
                focus: 'series'
            },
            data: [120, 132, 101, 134, 290],
            xAxisIndex: 1,
            yAxisIndex: 1,
        }
]
}
myChart.setOption(option);
